package com.csthink.auditlog.annotation;

import java.lang.annotation.*;

/**
 * @author <a href="mailto:security.2009@live.cn">Mars</a>
 * @since 2023-09-12
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@Documented
public @interface Change {

    /**
     * define whether batch changes or not, default is not;
     * when it's true, id, keyword, oldVal, newVal all should be List;
     */
    boolean sequence() default false;

    /**
     * pure string
     * If it is empty, will try to get type from oldVal and newVal.
     */
    Class type() default Void.class;

    /**
     * Use spEL to get value;
     */
    String id() default "";

    /**
     * Use spEL to get value;
     */
    String keyword() default "";

    /**
     * Use spEL to get value;
     * Always parsed before business logic execute.
     */
    String oldVal() default "";

    /**
     * Use spEL to get value;
     */
    String newVal() default "";
}
